package com.ziyunying.weather.common.utils

import android.util.Log
import com.google.gson.Gson
import com.ziyunying.weather.BuildConfig


object Logger {
    private const val TAG = "QWeather"
    private val gson = Gson()
    private val isDebug = BuildConfig.DEBUG

    fun logResponse(response: Any?, tag: String = TAG, message: String = "") {
        if (isDebug) {
            val json = gson.toJson(response)
            Log.d(tag, "$message\nJSON: $json")
        }
    }

    fun i(tag: String = TAG, message: String = "") {
        Log.d(tag, message)
    }
}
